from fractions import Fraction
# half=Fraction(1,2)
# print(half)
# b=half.__repr__()
# c=half.__str__()
# print(b+"\n"+c)
# print(repr(b))
# print(eval(repr(b)))
# print(type(1))
# def repr(x):
#     return type(x).__repr__(x)
# print(repr(2))
# b=float(3.4)

def gcd(m,n):
    max_m_n=max(m,n)
    min_m_n=min(m,n)
    if max_m_n%min_m_n==0:
        return min_m_n
    else:
        
        m=min_m_n
        n=max_m_n%min_m_n
    return gcd(m,n)
class Ratio:
    def __init__(self,numerator,denominator):
        self.numerator=numerator
        self.denominator=denominator
    def __repr__(self):
        return "Ratio({0},{1})".format(self.numerator,self.denominator)
    def __str__(self):
        return "{0}/{1}".format(self.numerator,self.denominator)
    def __add__(self, other):
        if isinstance(other,int):
            n=self.numerator+self.denominator*other
            m=self.denominator
        elif isinstance(other,Ratio):
            n=self.denominator*other.numerator+self.numerator*other.denominator
            m=self.denominator*other.denominator
        elif (isinstance(other,float)):
            return self.numerator/self.denominator+other
        g=gcd(n,m)
        return Ratio(n//g,m//g)
    
# a=Ratio(1,3)+1
# n=Ratio(1,3)+0.16666666666666666666
# list_n=[1,2,3,4] 
class kangaroo:
    pouch_pack=[]
    def put_in_pouch_pack(self,x):
        for baby in self.pouch_pack:
            if baby==x:
                return
        self.pouch_pack.append(x)
    def get_out_of_pouch(self,x):
        
        if x in self.pouch_pack:
            self.pouch_pack.remove(x)
            return "the baby has got out of the pouch"
        else:
            return ("the baby isn't in the pouch")
    def pouch_pack_checker(self):
        if len(self.pouch_pack)==0:
            return"there is no baby in the pouch"
        else:
            return "the babies in the pouch are: "+"\n"+str(self.pouch_pack)

a=kangaroo()
a.put_in_pouch_pack("baby1")
a.put_in_pouch_pack("baby1")

a.put_in_pouch_pack("baby2")

b=a.get_out_of_pouch("baby2")
a_check=a.pouch_pack_checker()
print(a_check)
print(b)


        
        

    